﻿using System;
using TSites.Service.Interfaces;
using TSites.Service;
using TSites.Service.Entities;
using System.Collections.Generic;

namespace TSites.GUI
{
	public class CompanySingleton
	{
		public readonly static CompanySingleton Instance = new CompanySingleton();
		private ICompanyService _companyService = new CompanyService();

		public Company GetCompany(string id)
		{
			return _companyService.GetCompany(id);
		}

		public Company[] GetCompanies(string comName, int language)
		{
			return _companyService.GetList(comName, language);
		}

		public int Add(Company com)
		{
			return _companyService.Insert(com);
		}

		public int Update(Company com)
		{
			return _companyService.Update(com);
		}

		public int Remove(string id)
		{
			return _companyService.Delete(id);
		}

		public List<string> GetWorkSheets(string filePath)
		{
			return _companyService.GetWorkSheets(filePath);
		}

		public int ImportExcel(string filePath, string workSheetName)
		{
			return _companyService.ImportExcel(filePath, workSheetName);
		}

		public bool CheckCompanyName(string vnComName, string enComName, string Id = null)
		{
			return _companyService.CheckCompanyName(vnComName, enComName, Id);
		}
	}
}
